
<template>
  <el-table v-loading="loading" :data="orderList">
    <el-table-column label="订单号" align="center" prop="id" />
    <el-table-column label="用户" align="center" prop="user.nickName" />
    <el-table-column label="门店" align="center" prop="dept.deptName" />
    <el-table-column label="订单状态" align="center" prop="status">
      <template slot-scope="scope">
        <dict-tag :options="dict.type.order_status" :value="scope.row.status"/>
      </template>
    </el-table-column>
    <el-table-column label="药剂数量" align="center" prop="resultCount" />
  </el-table>
</template>

<script>
import { listOrder } from '@/api/manage/order'

export default {
  dicts: ['order_status'],
  props:{
    deptId: {
      type: Number,
      required: true,
    }
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      admin: true,
      orderList: [],
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        deptId: null,
        status: null,
      },
    };
  },mounted() {
    if(this.deptId!=100){
      this.queryParams.deptId = this.deptId
    }

    this.getList();
  },
  methods: {
    getList() {
      this.loading = true;
      listOrder(this.queryParams).then(response => {
        this.orderList = response.rows;
        this.loading = false;
      });
    },
  }
}
</script>

<style scoped lang="scss">

</style>
